package com.gitee.wsl.common.ui.symbol.generator

import androidx.compose.ui.graphics.Path
import kotlin.math.PI

internal const val epsilon:Float = 1.0E-12F
internal const val pi:Float = PI.toFloat()
internal const val halfPi:Float = pi / 2
internal const val tau:Float = 2 * pi

fun <T, D> const(constantValue: T): (D) -> T = { constantValue }

abstract class PathBuilder<D>{
    abstract fun <C : Path> build(data: List<D>, path: C): C

    fun Path.build(data: List<D>) = build(data,this)

    companion object
}


// fun <T> render(init: SymbolGenerator<T>.() -> Unit): SymbolGenerator<T> = SymbolGenerator<T>().apply(init)


 abstract class SymbolGenerator<T,D>(
     var type: (T,index:Int) -> D
 ): PathBuilder<T>() {

     var size: (T) -> Double = const(64.0)
     
     companion object
}

